package com.fbty.mt.service;

import java.util.List;
import java.util.Map;

import com.fbty.base.domain.Page;
import com.fbty.mt.domain.OnlyIpInfo;
import com.fbty.mt.domain.UserIpInfo;

public interface UserIpInfoService {
	/**
	 * 
	 * Description: 获取用户已用数量<br>
	 * 并修改 已经统计的记录
	 * @param uid
	 * @return
	 */
	public int updateUseNum(int uid);
	
	/**
	 * 
	 * Description:保存购买的ip地址 <br>
	 * @param userIpInfo
	 */
	public void saveMyIpInfo(UserIpInfo userIpInfo,int num,boolean flag);
	
	/**
	 * 
	 * Description: 分页获得已用的共享ip<br>
	 * @return
	 */
	public Page queryShareIp(int pageNo, int pageSize, String state,int uid,String type,String country,String region,String city);
	/**
	 * 
	 * Description: 分页获得已购买的独享ip<br>
	 * @param pageNo
	 * @param pageSize
	 * @param map
	 * @return
	 */
	public Page queryOnlyIp(int pageNo, int pageSize, String state,int uid,String type,String country,String region,String city);
	
	/**
	 * 
	 * Description:判断是否有重复的ip <br>
	 * @param ipid
	 * @param uid
	 * @return
	 */
	public boolean repeat(int ipid,int uid);
	
	public void saveMyOnlyIp(UserIpInfo userIpInfo);
	
	public int queryIpState(int ipid);
	
	/**
	 * 
	 * Description:查询单个ip <br>
	 * @param ipid
	 * @return
	 * @throws Exception
	 */
	public OnlyIpInfo findIpById(int ipid) throws Exception;
	
	/**
	 * 
	 * Description:查询单个ip的详细信息 <br>
	 * @param ipid
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> findMsg(int ipid) throws Exception;
	
	public UserIpInfo findUserIpById(int id)throws Exception;
	
	public void modifyUserIpInfo(UserIpInfo userIpInfo) throws Exception;
	
	/**
	 * 
	 * Description: <br>更换独享IP
	 * @param useripInfo 用户ip
	 * @param info 独享ip
	 * @return
	 * @throws Exception
	 */
	public int modifyOnlyIP(UserIpInfo ipInfo,OnlyIpInfo info)throws Exception;
	
	/**
	 * 
	 * Description: <br>获取用户购买的独享ip
	 * @param pageNo
	 * @param pageSize
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Page queryAllUserIp(int pageNo, int pageSize,Map<String,String> map,Map<String,String> likeMap) throws Exception;
	
	/**
	 * 
	 * Description: <br>修改到期独享IP
	 * @throws Exception
	 */
	public void modifyEndTimeIp() throws Exception;
	
	/**
	 * 
	 * Description: <br>管理员更换ip
	 * @param upid
	 * @param ipid
	 * @throws Exception
	 */
	public void modifyAutoChange(int upid,int ipid) throws Exception;

}
